﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WPF_DragDrop_UI_Demo
{
    public class RegionManager
    {
        public Dictionary<string, ObservableCollection<SensorViewModel>> RegionData { get; private set; }

        public RegionManager()
        {
            RegionData = new Dictionary<string, ObservableCollection<SensorViewModel>>();
        }

        public void AddDataToRegion(string regionName, SensorViewModel sensorData)
        {
            if (!RegionData.ContainsKey(regionName))
            {
                RegionData[regionName] = new ObservableCollection<SensorViewModel>();
            }

            RegionData[regionName].Add(sensorData);
        }

        public ObservableCollection<SensorViewModel> GetDataForRegion(string regionName)
        {
            RegionData.TryGetValue(regionName, out var data);
            return data;
        }
    }


}
